<template>
  <div id="shop-tab">
    <div class="tab-bar">
      <div class="connect">
        <div class="icon" slot="item-icon"></div>
        <div slot="item-text">客服</div>
      </div>
      <div class="shop">
        <div class="icon" slot="item-icon"></div>
        <div slot="item-text">店铺</div>
      </div>
      <div class="addcart" @click="addToCart">
        <div slot="item-text">加入购物车</div>
      </div>
      <div class="purchase" @click="urlClick">
        <div slot="item-text">购买</div>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name:'ShopBar',
  methods:{
    addToCart(){
      this.$emit('addCart')
    },
    urlClick(){
      this.$router.push('/cart')
    }
  }
}
</script>

<style scoped>
#shop-tab{
  height: 49px;
  position: fixed;
  bottom: -2px;
  left: 0;
  right: 0;
  font-size: 14px;
}
#shop-tab .tab-bar{
  display: flex;
  text-align: center;
  background-color: #fff;
  color: #000;
}
#shop-tab .tab-bar>div{
  flex:1
}
.icon{
  width: 28px;
  height: 28px;
  margin: 0 auto;
  background: url('~assets/img/detail/detail_bottom.png');
  background-repeat: no-repeat;
  background-size: 100%;
  
}
.connect .icon{
  background-position: 0 -66px;
}
.shop .icon{
  background-position: 0 -124px;
}
.addcart{
  line-height: 49px;
  background: #f1c40f;
}
.purchase{
  line-height: 49px;
  color: #fff;
  background:var(--color-tint);
}
</style>
